import request from '@/utils/request';

const prefix = '/menu';

export const getMenuTree = (data) => {
  return request.get(`${prefix}/tree`, {
    params: data,
  });
};

export const createMenu = (data) => {
  return request.post(`${prefix}`, data);
};

export const deleteMenu = (id) => request.delete(`${prefix}/${id}`);
export const getMenuDetail = (id) => request.get(`${prefix}/${id}`);
export const updateMenu = (id, data) => request.put(`${prefix}/${id}`, data);
